home *** CD-ROM | disk | FTP | other *** search
/ TPUG - Toronto PET Users Group / TPUG Users Group CD / TPUG Users Group CD.iso / CRS / crs32.d81 / examples.arc / EIGHTY.A < prev    next >
Text File  |  1989-12-01  |  3KB  |  94 lines

  1. ; eighty.asm
  2. ;---------------------------------------------
  3. ; Set 80 column RGB mode (Recover from forty)
  4. ;---------------------------------------------
  5.                                   
  6. star        = $0b00               
  7.             .wor star             
  8.             * = star              
  9.                                   
  10. colums      = $00ee               
  11. int0e       = $170e               
  12. chrout      = $ffd2
  13. plot        = $fff0
  14. primm       = $ff7d               
  15.  
  16.             jmp forty
  17.             dw Date
  18.                       
  19. forty       ldx #25               ; set pixels to double width
  20.             jsr readrg            
  21.             and #%11101111
  22.             sta vdc2              
  23.             ldy #0                
  24. for0        lda vdctab,y
  25.             iny                   
  26.             ldx vdctab,y
  27.             bmi for1
  28.             iny                   
  29.             jsr writrg            
  30.             jmp for0              
  31.                                   
  32. for1        sec
  33.             jsr plot
  34.             txa
  35.             pha
  36.             tya
  37.             pha
  38.             lda #79
  39.             sta colums
  40.             lda #19
  41.             jsr chrout
  42.             lda #19
  43.             jsr chrout
  44.             pla
  45.             tay
  46.             pla
  47.             tax
  48.             clc
  49.             jsr plot
  50. ;            lda #147
  51. ;            jsr chrout
  52. ;            lda #79
  53. ;            sta colums
  54. ;            jsr primm
  55. ;            .asc 19,19,147,0
  56.             jmp int0e             
  57.                                   
  58. ;-------------------------------------
  59. ;Table of VDC value,register to change
  60. ;-------------------------------------
  61. ; These are the power up values
  62.                                   
  63. vdctab      .byt 126, 0           ; total screen width in chars
  64.             .byt  80, 1           ; 40 displayable chars per row
  65.             .byt 102, 2
  66.             .byt $47, 25
  67.             .byt $78, 22          ; character horizontal size control
  68.             .byt   0, 27          ; Address increment per row
  69.             .byt 102, 2           ; horizontal sync
  70. vdc2        .byt   0, 25          ; mode control
  71.             .byt $ff,$ff
  72.  
  73. ;----------------------------------
  74. ; Subroutine: read VDC register .x
  75. ;----------------------------------
  76.                                   
  77. readrg      stx $d600             
  78. rd          bit $d600             
  79.             bpl rd                
  80.             lda $d601             
  81.             rts                   
  82.                                   
  83. ;----------------------------------
  84. ; Subroutine: write VDC register .x
  85. ;----------------------------------
  86.                                   
  87. writrg      stx $d600             
  88. wr          bit $d600             
  89.             bpl wr                
  90.             sta $d601             
  91.             rts                   
  92.                                   
  93.             .end                  
  94.